package cn.com.connext.scrm.service;

import cn.com.connext.scrm.domain.master.BuryingPointBaileysPrizeButtonClick;
import cn.com.connext.scrm.domain.master.BuryingPointBaileysRegister;
import cn.com.connext.scrm.repository.master.BuryingPointBaileysPrizeButtonClickRepository;
import cn.com.connext.scrm.service.dto.JsonResult;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;


@Service
@Transactional
public class BuryingPointBaileysPrizeButtonClickService {
    @Autowired
    private BuryingPointBaileysPrizeButtonClickRepository amcRepository;



    public JsonResult savePrizeButtonClick(BuryingPointBaileysPrizeButtonClick entity) {
        JsonResult result =new JsonResult();
        if(StringUtils.isEmpty(entity.getUnionId())){
            result.setMessage("用户参数不能为空!");
            result.setState(-1);
        }else{
            amcRepository.saveAndFlush(entity);
            result.setMessage("添加成功");
            result.setState(0);
        }
        return result;
    }
}
